import {AnyAction} from "redux";
import {handleActions} from "redux-actions";
import initState from "./state";

export const depart = handleActions({
    "DEPART_LIST": (state, action: AnyAction) => {
        return {...state, list: action.payload.data}
    },
    "DEPART_EXPAND_ITEM": (state, action: AnyAction) => {
        return {...state, expands: action.payload.id === state.expands ? "" : action.payload.id};
    },
}, initState);